#pragma once
#include "Structures.h"
#include "Definitions.h"
#include "LostVector.h"

class Button
{
private:
	DrawStruct	drawInfo;		//Information for the button used for rendering
	SoundStruct	soundInfo;		//Information for the sound to be played when the mouse is over a button
	char*		text;			//Text that will be displayed on the button
	XY			bottomRight;	//Size of the button (the bottom right corner)
	bool		selected;		//Bool to check if the button is currently selected
	bool		justSelected;	//To check if the sound should be played
	int			buttonNum;		//The number of the button

public:
	//Constructor
	Button();

	//////////////////////////////////////////////////////////////////////////
	// Name:		MouseOver
	// Parameters:	XY a_mousePosition -	XY struct that represent the
	//										mouse coordinates
	// Return:		bool
	// Description:	Checks if the mouse coordinates are within the currently
	//				evaluated button and if so return true.
	//////////////////////////////////////////////////////////////////////////
	bool MouseOver(XY a_mousePosition);

	//////////////////////////////////////////////////////////////////////////
	// Name:		Draw
	// Parameters:	LostVector<DrawStruct>* draw -	Uses a vector (made by
	//												Kiko Olvera) of draw
	//												structures to add an
	//												object that will be drawn
	// Return:		void
	// Description:	Adds the currently evaluated button's draw info to the
	//				draw list to be drawn by view.
	//////////////////////////////////////////////////////////////////////////
	void Draw(LostVector<DrawStruct>* draw, LostVector<SoundStruct>* sound);

/////////////////////////////////////////////////////////////////////////////////////////////////////////
//Gets and sets
/////////////////////////////////////////////////////////////////////////////////////////////////////////
	void SetPosition(float a_x, float a_y)
	{
		drawInfo.pos.x	= a_x;
		drawInfo.pos.y	= a_y;
		bottomRight.x	= drawInfo.pos.x + DEFAULT_BUTTON_SIZE_X;
		bottomRight.y	= drawInfo.pos.y + DEFAULT_BUTTON_SIZE_Y;
	}

	void SetText(char* a_text)
	{
		text = a_text;
	}

	void SetButtonID(int a_buttonID)
	{
		buttonNum = a_buttonID;
	}

	int GetButtonID()
	{
		return buttonNum;
	}

	DrawStruct GetDrawInfo()
	{
		return drawInfo;
	}
};